platform :ios, '9.3'
use_frameworks!

pod 'SweeterSwift', :path => '..'
pod 'SwiftQuality', :git => 'https://github.com/yonat/SwiftQuality'

def quality_scripts
  script_phase :name => 'SwiftFormat',
    :execution_position => :before_compile,
    :script => 'if [ "Debug" == "${CONFIGURATION}" ]; then "${PODS_ROOT}/SwiftFormat/CommandLineTool/swiftformat" --swiftversion ${SWIFT_VERSION} --config "${PODS_ROOT}/SwiftQuality/.swiftformat" "${SRCROOT}/.." ; fi'

  script_phase :name => 'SwiftLintAutocorrect',
    :execution_position => :before_compile,
    :script => 'if [ "Debug" == "${CONFIGURATION}" ]; then "${PODS_ROOT}/SwiftLint/swiftlint" autocorrect --config "${PODS_ROOT}/SwiftQuality/.swiftlint.yml" --path "${SRCROOT}/.." ; fi'

  script_phase :name => 'SwiftLint',
    :execution_position => :after_compile,
    :script => 'if [ "Debug" == "${CONFIGURATION}" ]; then "${PODS_ROOT}/SwiftLint/swiftlint" --config "${PODS_ROOT}/SwiftQuality/.swiftlint.yml" --path "${SRCROOT}/.." ; fi'
end

target 'SweeterSwift' do
  quality_scripts
end

target 'SweeterSwiftTests' do
  quality_scripts
end
